/*
 * Copyright (C) 2017 Pingan, Inc. All Rights Reserved.
 */

package com.pingan.haofang.searchcloud.es.indices;

import com.pingan.haofang.searchcloud.api.DiskConditonDTO;
import com.pingan.haofang.searchcloud.api.matedata.CollectionMetaData;

import java.util.List;
import java.util.Map;

/**
 * 索引管理逻辑
 *
 * @author zhangbi617
 * @date 2017-07-04
 */
public interface IndicesManagerService {

    /**
     * 创建索引
     *
     * @param host
     * @param indicesMetaData
     */
    boolean create(String host, CollectionMetaData indicesMetaData);

    /**
     * 删除索引
     *
     * @param host
     * @param indicesName
     */
    boolean delete(String host, String indicesName);

    /**
     * 获取所有的索引名
     *
     * @param host
     * @return
     */
    List<String> getIndicesNames(String host);

    /**
     * 获取集群中的存活的节点
     *
     * @param clusterHost 集群host
     * @return
     */
    List<String> getLiveHostUrl(String clusterHost);

    /**
     * 获取集群中节点的统计信息
     *
     * @param clusterHost 集群host
     * @return
     */
    Map<String, DiskConditonDTO> getNodesSummary(String clusterHost);
}
